//
//  NSObject+Extension.swift
//  CosClub_Basis
//
//  Created by iOS on 2020/5/21.
//  Copyright © 2020 iOS. All rights reserved.
//

import Foundation
func SwiftClassFromString(_ className: String, moduleName: String? = nil) -> AnyClass! {
    // get the project name
    var projectName = moduleName
    if projectName == nil {
        projectName = Bundle.main.object(forInfoDictionaryKey: "CFBundleName") as! String?
    }
    guard projectName != nil else {
        return nil
    }
    
    let classStringName = projectName! + "." + className
    return NSClassFromString(classStringName)
}
